﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FourthApp
{
    public partial class FrmStart : Form
    {
        public FrmStart()
        {
            InitializeComponent();
        }

        private void btnStartWebApp_Click(object sender, EventArgs e)
        {
            string webAppPath = @"D:\code\LearnCefsharp\LearnCefsharp\WebDemo\bin\Debug\netcoreapp3.1\WebDemo.exe";
            //Process process = new Process();
            //process.StartInfo.FileName = webAppPath; //"diskpart.exe";
            //process.StartInfo.UseShellExecute = false;
            //process.StartInfo.CreateNoWindow = true;
            //var result = process.Start();
            //MessageBox.Show(result.ToString());

            Process process = new Process();
            ProcessStartInfo startInfo = new ProcessStartInfo(webAppPath);
            startInfo.UseShellExecute = false;
            process.StartInfo = startInfo;
            process.Start();
            process.WaitForExit();
            process.Close();

        }
    }
}
